import requests

# GitHub API URL
api_url = "https://api.github.com/search/users?q=location:China&sort=followers&order=desc"

# 发送请求获取 GitHub 用户数据
response = requests.get(api_url)
data = response.json()

# 获取前十名用户
top_10_users = data['items'][:10]

# 打印排行榜
print("Top 10 Developers by Followers:")
for index, user in enumerate(top_10_users, start=1):
    username = user['login']
    followers = user['followers']
    print(f"{index}. {username}: {followers} followers")

# 如果需要获取更多的信息，可以使用用户的用户名再次查询用户详细信息
# 例如，可以使用 https://api.github.com/users/{username} 获取用户详细信息
